package com.voice.server.exception;


import com.wangjiacai.utils.enums.CodeEnum;
import com.wangjiacai.utils.enums.ResultEnum;
import com.wangjiacai.utils.web.exception.CodeMessageException;
import lombok.Getter;

@Getter
public class SystemException extends CodeMessageException {

    private Integer code;

    public SystemException(CodeEnum codeEnum) {
        super(codeEnum.getMessage());

        this.code = codeEnum.getCode();
    }

    public SystemException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public SystemException(String message) {
        super(message);
        this.code = ResultEnum.SERVER_ERROR.getCode();
    }
}
